<?php 

class Timer{
	
	var $starttime;
	var $endtime;
	var $totaltime;
	
	function start(){
    $this->starttime = microtime(true);
	}

	function stop(){
		$this->endtime = microtime(true);
	}
	
	function totaltime(){
		$this->totaltime = ($this->endtime - $this->starttime); 
		printf( "Script timer: <b>%f</b> seconds.<br/>", ($this->totaltime) ); 
	}
}
?>